home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-freed-smtp-pipeline-00.txt < prev    next >
Text File  |  1993-10-20  |  12KB  |  469 lines

  1.  
  2. Network Working Group                                Ned Freed
  3. Internet Draft
  4. <draft-freed-smtp-pipeline-00.txt> 
  5.  
  6.                     SMTP Service Extension
  7.                     for Command Pipelining
  8.  
  9.                          19-Oct-1993
  10.  
  11.  
  12.                      Status of this Memo
  13.  
  14. This document is an Internet Draft. Internet Drafts are
  15. working documents of the Internet Engineering Task Force
  16. (IETF), its Areas, and its Working Groups.  Note that other
  17. groups may also distribute working documents as Internet
  18. Drafts.
  19.  
  20. Internet Drafts are valid for a maximum of six months and may
  21. be updated, replaced, or obsoleted by other documents at any
  22. time. It is inappropriate to use Internet Drafts as reference
  23. material or to cite them other than as a "work in progress".
  24.  
  25.  
  26. 1.  Abstract
  27.  
  28. This memo defines an extension to the SMTP service whereby a
  29. server can indicate the extent of its ability to accept
  30. multiple commands in a single TCP send operation. Using a
  31. single TCP send operation for multiple commands can improve
  32. SMTP performance significantly.
  33.  
  34.  
  35. 2.  Introduction
  36.  
  37. Although SMTP is widely and robustly deployed, various
  38. extensions have been requested by some parts of the Internet
  39. community. In particular, many parts of the Internet make use
  40. of high latency network links. SMTP's intrinsic one command-
  41. one response structure is significantly penalized by high
  42. latency links, often to the point where the factors
  43. contributing to overall connection time are dominated by the
  44. time spent waiting for responses to individual commands
  45. (turnaround time).
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. Internet Draft         SMTP Pipelining                Oct 1993
  60.  
  61.  
  62. In the best of all worlds it would be possible to simply
  63. deploy SMTP client software that makes use of command
  64. pipelining: batching up multiple commands into single TCP send
  65. operations. Unfortunately, the original SMTP specification [1]
  66. did not explicitly state that SMTP servers must support this
  67. type of operation. As a result a non-trivial number of
  68. Internet SMTP servers cannot adequately handle command
  69. pipelining. Flaws known to exist in deployed servers include:
  70.  
  71. (1)  Process forking and connection handoff in the middle of
  72.      the SMTP dialogue.  Creation of server processes for
  73.      incoming SMTP connections is a useful, obvious, and
  74.      harmless implementation technique. However, some SMTP
  75.      servers defer process forking and connection handoff
  76.      until some intermediate point in the SMTP dialogue is
  77.      reached. When this is done material read from the TCP
  78.      connection and kept in process-specific buffers can be
  79.      lost.
  80.  
  81. (2)  Flushing the TCP input buffer when an SMTP command fails.
  82.      SMTP commands often fail but there is no reason to flush
  83.      the TCP input buffer when this happens.  Nevertheless,
  84.      some SMTP servers do this.
  85.  
  86. (3)  Improper processing and promulgation of SMTP command
  87.      failures. For example, some SMTP servers will refuse to
  88.      accept a DATA command if the last RCPT TO command fails,
  89.      paying no attention to the success or failure of prior
  90.      RCPT TO command results. Other servers will accept a DATA
  91.      command even when all previous RCPT TO commands have
  92.      failed. Although it is possible to accomodate this sort
  93.      of behavior in a client that employs command pipelining,
  94.      it does complicate the construction of the client
  95.      unnecessarily.
  96.  
  97. This memo uses the mechanism described in [2] to define an
  98. extension to the SMTP service whereby an SMTP server can
  99. declare that it is capable of handling pipelined commands. The
  100. SMTP client can then check for this declaration and use
  101. pipelining only when the server declares itself capable of
  102. handling it.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.                        Expires Apr 1994               [Page 2]
  113.  
  114.  
  115.  
  116.  
  117.  
  118. Internet Draft         SMTP Pipelining                Oct 1993
  119.  
  120.  
  121. 3.  Framework for the Command Pipelining Extension
  122.  
  123. The Command Pipelining extension is defined as follows:
  124.  
  125. (1)  the name of the SMTP service extension is Pipelining;
  126.  
  127. (2)  the EHLO keyword value associated with the extension is
  128.      PIPELINING;
  129.  
  130. (3)  no parameter is used with the PIPELINING EHLO keyword;
  131.  
  132. (4)  no additional parameters are added to either the MAIL
  133.      FROM or RCPT TO commands.
  134.  
  135. (5)  no additional SMTP verbs are defined by this extension;
  136.      and,
  137.  
  138. (6)  the next section specifies how support for the extension
  139.      affects the behavior of a server and client SMTP.
  140.  
  141.  
  142. 4.  The Pipelining Service Extension
  143.  
  144. When a client SMTP wishes to employ command pipelining, it
  145. first issues the EHLO command to the server SMTP. If the
  146. server SMTP responds with code 250 to the EHLO command, and
  147. the response includes the EHLO keyword value PIPELINING, then
  148. the server SMTP has indicated that it can accomodate SMTP
  149. command pipelining.
  150.  
  151.  
  152. 4.1.  Client use of pipelining
  153.  
  154. Once the client SMTP has confirmed that support exists for the
  155. pipelining extension, the client SMTP may then elect to
  156. transmit groups of SMTP commands in batches without waiting
  157. for a response to each individual command. In particular, the
  158. commands RSET, MAIL FROM, SEND FROM, SOML FROM, SAML FROM, and
  159. RCPT TO can all appear anywhere in a pipelined command group.
  160. The EHLO, DATA, VRFY, EXPN, TURN, QUIT, and NOOP commands can
  161. only appear as the last command in a group since their success
  162. or failure produces a change of state which the client SMTP
  163. must accomodate. (NOOP is included in this group so it can be
  164. used as a synchronization point.)
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.                        Expires Apr 1994               [Page 3]
  172.  
  173.  
  174.  
  175.  
  176.  
  177. Internet Draft         SMTP Pipelining                Oct 1993
  178.  
  179.  
  180. Additional commands added by other SMTP extensions may only
  181. appear as the last command in a group unless otherwise
  182. specified by the extensions that define the commands.
  183.  
  184. Client SMTP implementations that employ pipelining MUST check
  185. all statuses associated with each command in the group. For
  186. example, if none of the RCPT TO recipient addresses were
  187. accepted the client must then check the response to the DATA
  188. command. If the DATA command was properly rejected the client
  189. SMTP can just issue RSET, but if the DATA command was accepted
  190. the client SMTP should send a single dot.
  191.  
  192. Client SMTP implementations MUST also check the TCP window
  193. size and make sure that each group of commands fits entirely
  194. within the window. The window size is usually, but not always,
  195. 4K octets. Failure to perform this check can lead to deadlock
  196. conditions.
  197.  
  198.  
  199. 4.2.  Server support of pipelining
  200.  
  201. A server SMTP implementation that offers the pipelining
  202. extension:
  203.  
  204. (1)  MUST NOT flush or otherwise lose the contents of the TCP
  205.      input buffer under any circumstances whatsoever.
  206.  
  207. (2)  SHOULD issue a positive response to the DATA command if
  208.      and only if one or more valid RCPT TO addresses have been
  209.      previously received.
  210.  
  211. (3)  MAY elect to store command responses to RSET, MAIL FROM,
  212.      SEND FROM, SOML FROM, SAML FROM, and RCPT TO in an
  213.      internal buffer so they can sent as a unit.
  214.  
  215. (4)  MUST NOT buffer responses to EHLO, DATA, VRFY, EXPN,
  216.      TURN, QUIT, and NOOP.
  217.  
  218. (5)  MUST NOT buffer responses to unrecognized commands.
  219.  
  220. (6)  MUST send all pending responses immediately whenever the
  221.      local TCP input buffer is emptied.
  222.  
  223. (7)  MUST NOT make assumptions about commands that are yet to
  224.      be received.
  225.  
  226.  
  227.  
  228.  
  229.  
  230.                        Expires Apr 1994               [Page 4]
  231.  
  232.  
  233.  
  234.  
  235.  
  236. Internet Draft         SMTP Pipelining                Oct 1993
  237.  
  238.  
  239. The overriding intent of these server requirements is to make
  240. it as easy as possible for servers to conform to these
  241. pipelining extensions.
  242.  
  243. 5.  Examples
  244.  
  245. Consider the following SMTP dialogue that does not use
  246. pipelining:
  247.  
  248. S: <wait for open connection>
  249. C: <open connection to server>
  250. S: 220 innosoft.com SMTP service ready
  251. C: HELO dbc.mtview.ca.us
  252. S: 250 innosoft.com
  253. C: MAIL FROM:<mrose@dbc.mtview.ca.us>
  254. S: 250 sender <mrose@dbc.mtview.ca.us> OK
  255. C: RCPT TO:<ned@innosoft.com>
  256. S: 250 recipient <ned@innosoft.com> OK
  257. C: RCPT TO:<dan@innosoft.com>
  258. S: 250 recipient <dan@innosoft.com> OK
  259. C: RCPT TO:<kvc@innosoft.com>
  260. S: 250 recipient <kvc@innosoft.com> OK
  261. C: DATA
  262. S: 354 enter mail, end with line containing only "."
  263.  ...
  264. C: .
  265. S: 250 message sent
  266. C: QUIT
  267. S: 250 goodbye
  268.  
  269. The client waits for a server response a total of 9 times in
  270. this simple example. But if pipelining is employed the
  271. following dialogue is possible:
  272.  
  273. S: <wait for open connection>
  274. C: <open connection to server>
  275. S: 220 innosoft.com SMTP service ready
  276. C: EHLO dbc.mtview.ca.us
  277. S: 250-innosoft.com
  278. S: 250 PIPELINING
  279. C: MAIL FROM:<mrose@dbc.mtview.ca.us>
  280. C: RCPT TO:<ned@innosoft.com>
  281. C: RCPT TO:<dan@innosoft.com>
  282. C: RCPT TO:<kvc@innosoft.com>
  283. C: DATA
  284.  
  285.  
  286.  
  287.  
  288.  
  289.                        Expires Apr 1994               [Page 5]
  290.  
  291.  
  292.  
  293.  
  294.  
  295. Internet Draft         SMTP Pipelining                Oct 1993
  296.  
  297.  
  298. S: 250 sender <mrose@dbc.mtview.ca.us> OK
  299. S: 250 recipient <ned@innosoft.com> OK
  300. S: 250 recipient <dan@innosoft.com> OK
  301. S: 250 recipient <kvc@innosoft.com> OK
  302. S: 354 enter mail, end with line containing only "."
  303.  ...
  304. C: .
  305. C: QUIT
  306. S: 250 message sent
  307. S: 250 goodbye
  308.  
  309. The total number of turnarounds has been reduced from 9 to 4.
  310.  
  311. The next example illustrates one possible form of behavior
  312. when pipelining is used and all recipients are rejected:
  313.  
  314. S: <wait for open connection>
  315. C: <open connection to server>
  316. S: 220 innosoft.com SMTP service ready
  317. C: EHLO dbc.mtview.ca.us
  318. S: 250-innosoft.com
  319. S: 250 PIPELINING
  320. C: MAIL FROM:<mrose@dbc.mtview.ca.us>
  321. C: RCPT TO:<nsb@thumper.bellcore.com>
  322. C: RCPT TO:<galvin@tis.com>
  323. C: DATA
  324. S: 250 sender <mrose@dbc.mtview.ca.us> OK
  325. S: 550 remote to <nsb@thumper.bellore.com> not allowed
  326. S: 250 remote to <galvin@tis.com> not allowed
  327. S: 550 no valid recipients given
  328. C: QUIT
  329. S: 250 goodbye
  330.  
  331. The client SMTP waits for the server 4 times here as well. If
  332. the server SMTP does not check for at least one valid
  333. recipient prior to accepting the DATA command, the following
  334. dialogue would result:
  335.  
  336. S: <wait for open connection>
  337. C: <open connection to server>
  338. S: 220 innosoft.com SMTP service ready
  339. C: EHLO dbc.mtview.ca.us
  340. S: 250-innosoft.com
  341. S: 250 PIPELINING
  342. C: MAIL FROM:<mrose@dbc.mtview.ca.us>
  343.  
  344.  
  345.  
  346.  
  347.  
  348.                        Expires Apr 1994               [Page 6]
  349.  
  350.  
  351.  
  352.  
  353.  
  354. Internet Draft         SMTP Pipelining                Oct 1993
  355.  
  356.  
  357. C: RCPT TO:<nsb@thumper.bellcore.com>
  358. C: RCPT TO:<galvin@tis.com>
  359. C: DATA
  360. S: 250 sender <mrose@dbc.mtview.ca.us> OK
  361. S: 550 remote to <nsb@thumper.bellore.com> not allowed
  362. S: 550 remote to <galvin@tis.com> not allowed
  363. S: 354 enter mail, end with line containing only "."
  364.  ...
  365. C: .
  366. C: QUIT
  367. S: 550 no valid recipients
  368. S: 250 goodbye
  369.  
  370. 6.  Security Considerations
  371.  
  372. This RFC does not discuss security issues and is not believed
  373. to raise any security issues not endemic in electronic mail
  374. and present in fully conforming implementations of [1].
  375.  
  376.  
  377. 7.  Acknowledgements
  378.  
  379. This document is based on the SMTP service extension model
  380. presented in RFC 1425. Marshall Rose's description of SMTP
  381. command pipelining in his book "The Internet Message" also
  382. served as a source of inspiration for this extension.
  383.  
  384.  
  385. 8.  References
  386.  
  387. [1]  J.B. Postel.  Simple Mail Transfer Protocol. Request for
  388.      Comments 821, (August, 1982).
  389.  
  390. [2]  J.C. Klensin, N. Freed, M.T. Rose, E.A. Stefferud,
  391.      D.H. Crocker.  SMTP Service Extensions. RFC 1425,
  392.      (January, 1993).
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.                        Expires Apr 1994               [Page 7]
  408.  
  409.  
  410.  
  411.  
  412.  
  413. Internet Draft         SMTP Pipelining                Oct 1993
  414.  
  415.  
  416. 9.  Author Addresses
  417.  
  418. Ned Freed
  419. Innosoft International, Inc.
  420. 250 West First Street, Suite 240
  421. Claremont, CA 91711
  422. USA
  423.  tel: +1 909 624 7907
  424.  fax: +1 909 621 5319
  425.  email: ned@innosoft.com
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                        Expires Apr 1994               [Page 8]
  467.  
  468.  
  469.